package oopkChatLab;

public abstract class Encryption {
	public abstract char[] encrypt(char[] c);
	public abstract String decrypt(String s);
	public String encrypt(String s)
	{
		//Take string and put it in a char array
		char[] c=new char[s.length()];
		for (int i = 0; i < s.length(); i++) c[i]=(s.charAt(i));
		
		//run the encryption on the raw data
		c=encrypt(c);
		
		//Get the raw data and encode it as hex code characters
		StringBuilder sb=new StringBuilder();
		for (int i = 0; i < s.length(); i++)
			sb.append(String.format("%x", (int)c[i]));
		
		return sb.toString();
	}
}
